package cn.bugstack.types.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum ActivityStatusEnumVO {

    CREATE(0, "创建"),
    EFFECTIVE(1, "生效"),
    OVERDUE(2, "过期"),
    ABANDONED(3, "废弃"),
            ;

    private Integer code;
    private String info;

    public static ActivityStatusEnumVO valueof(Integer code) {
        switch (code) {
            case 0: return CREATE;
            case 1: return EFFECTIVE;
            case 2: return OVERDUE;
            case 3: return ABANDONED;
        }
        throw new RuntimeException("error! ActivityStatusEnumVO valueof(Integer "+ code +"), code("+code+") not exist!");
    }
}
